package com.ddx.common.enums;

/**
 * 产品 状态  0开启1关闭,2预约发布',
 */
public enum ProductStatus {

    OPEN(0,"开启"),
    CLOSE(1,"关闭"),
    RESERVATION(2,"预约发布");

    private Integer code;
    private String msg;
    ProductStatus(Integer code, String msg) {
        this.code=code;
        this.msg=msg;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static ProductStatus getProductStatus(Integer code) {
        for (ProductStatus t : ProductStatus.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }







}
